package mythread.demo001;

public class MyThread12_2Test_stop {
    public static void main(String[] args) {
//        Thread thread = Thread.currentThread();
//        System.out.println(thread.getName() + "," + thread.getId());

        //1、退出标志  run后终止
        //2、stop（suspend、resume）过期
        //3、interrupt(只是打了一个标记)


        try {
            MyThread12_2 thread12 = new MyThread12_2();
            thread12.start();
            thread12.sleep(2000);
            thread12.interrupt();//并不是立即执行

        } catch (InterruptedException e) {
            System.out.println("main catch");
            e.printStackTrace();
        }
        System.out.println("end");

    }
}
